<!DOCTYPE HTML>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>

<body>
    <div class="parent">
        <div id="test1">1</div>
        <div id="test2">2</div>
        <div id="test3">3</div>
    </div>

    <script>
        var foo = {
            bar: 10,
            fn: function () {
                console.log(this)
                console.log(this.bar)
            }
        }
        var fn1 = foo.fn
        fn1()
    </script>
</body>

</html>